<!doctype html>

<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>spellcheck.js (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>


  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>

<div class="clear"></div>

<h2><a href="local_closure_goog_spell_spellcheck.js.html">spellcheck.js</a></h2>

<pre class="prettyprint lang-js">
<a name="line1"></a>// Copyright 2007 The Closure Library Authors. All Rights Reserved.
<a name="line2"></a>//
<a name="line3"></a>// Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
<a name="line4"></a>// you may not use this file except in compliance with the License.
<a name="line5"></a>// You may obtain a copy of the License at
<a name="line6"></a>//
<a name="line7"></a>//      http://www.apache.org/licenses/LICENSE-2.0
<a name="line8"></a>//
<a name="line9"></a>// Unless required by applicable law or agreed to in writing, software
<a name="line10"></a>// distributed under the License is distributed on an &quot;AS-IS&quot; BASIS,
<a name="line11"></a>// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
<a name="line12"></a>// See the License for the specific language governing permissions and
<a name="line13"></a>// limitations under the License.
<a name="line14"></a>
<a name="line15"></a>/**
<a name="line16"></a> * @fileoverview Support class for spell checker components.
<a name="line17"></a> *
<a name="line18"></a> * @author eae@google.com (Emil A Eklund)
<a name="line19"></a> */
<a name="line20"></a>
<a name="line21"></a>goog.provide(&#39;goog.spell.SpellCheck&#39;);
<a name="line22"></a>goog.provide(&#39;goog.spell.SpellCheck.WordChangedEvent&#39;);
<a name="line23"></a>
<a name="line24"></a>goog.require(&#39;goog.Timer&#39;);
<a name="line25"></a>goog.require(&#39;goog.events.EventTarget&#39;);
<a name="line26"></a>goog.require(&#39;goog.structs.Set&#39;);
<a name="line27"></a>
<a name="line28"></a>
<a name="line29"></a>
<a name="line30"></a>/**
<a name="line31"></a> * Support class for spell checker components. Provides basic functionality
<a name="line32"></a> * such as word lookup and caching.
<a name="line33"></a> *
<a name="line34"></a> * @param {Function=} opt_lookupFunction Function to use for word lookup. Must
<a name="line35"></a> *     accept an array of words, an object reference and a callback function as
<a name="line36"></a> *     parameters. It must also call the callback function (as a method on the
<a name="line37"></a> *     object), once ready, with an array containing the original words, their
<a name="line38"></a> *     spelling status and optionally an array of suggestions.
<a name="line39"></a> * @param {string=} opt_language Content language.
<a name="line40"></a> * @constructor
<a name="line41"></a> * @extends {goog.events.EventTarget}
<a name="line42"></a> * @final
<a name="line43"></a> */
<a name="line44"></a>goog.spell.SpellCheck = function(opt_lookupFunction, opt_language) {
<a name="line45"></a>  goog.events.EventTarget.call(this);
<a name="line46"></a>
<a name="line47"></a>  /**
<a name="line48"></a>   * Function used to lookup spelling of words.
<a name="line49"></a>   * @type {Function}
<a name="line50"></a>   * @private
<a name="line51"></a>   */
<a name="line52"></a>  this.lookupFunction_ = opt_lookupFunction || null;
<a name="line53"></a>
<a name="line54"></a>  /**
<a name="line55"></a>   * Cache for words not yet checked with lookup function.
<a name="line56"></a>   * @type {goog.structs.Set}
<a name="line57"></a>   * @private
<a name="line58"></a>   */
<a name="line59"></a>  this.unknownWords_ = new goog.structs.Set();
<a name="line60"></a>
<a name="line61"></a>  this.setLanguage(opt_language);
<a name="line62"></a>};
<a name="line63"></a>goog.inherits(goog.spell.SpellCheck, goog.events.EventTarget);
<a name="line64"></a>
<a name="line65"></a>
<a name="line66"></a>/**
<a name="line67"></a> * Delay, in ms, to wait for additional words to be entered before a lookup
<a name="line68"></a> * operation is triggered.
<a name="line69"></a> *
<a name="line70"></a> * @type {number}
<a name="line71"></a> * @private
<a name="line72"></a> */
<a name="line73"></a>goog.spell.SpellCheck.LOOKUP_DELAY_ = 100;
<a name="line74"></a>
<a name="line75"></a>
<a name="line76"></a>/**
<a name="line77"></a> * Constants for event names
<a name="line78"></a> *
<a name="line79"></a> * @enum {string}
<a name="line80"></a> */
<a name="line81"></a>goog.spell.SpellCheck.EventType = {
<a name="line82"></a>  /**
<a name="line83"></a>   * Fired when all pending words have been processed.
<a name="line84"></a>   */
<a name="line85"></a>  READY: &#39;ready&#39;,
<a name="line86"></a>
<a name="line87"></a>  /**
<a name="line88"></a>   * Fired when all lookup function failed.
<a name="line89"></a>   */
<a name="line90"></a>  ERROR: &#39;error&#39;,
<a name="line91"></a>
<a name="line92"></a>  /**
<a name="line93"></a>   * Fired when a word&#39;s status is changed.
<a name="line94"></a>   */
<a name="line95"></a>  WORD_CHANGED: &#39;wordchanged&#39;
<a name="line96"></a>};
<a name="line97"></a>
<a name="line98"></a>
<a name="line99"></a>/**
<a name="line100"></a> * Cache. Shared across all spell checker instances. Map with langauge as the
<a name="line101"></a> * key and a cache for that language as the value.
<a name="line102"></a> *
<a name="line103"></a> * @type {Object}
<a name="line104"></a> * @private
<a name="line105"></a> */
<a name="line106"></a>goog.spell.SpellCheck.cache_ = {};
<a name="line107"></a>
<a name="line108"></a>
<a name="line109"></a>/**
<a name="line110"></a> * Content Language.
<a name="line111"></a> * @type {string}
<a name="line112"></a> * @private
<a name="line113"></a> */
<a name="line114"></a>goog.spell.SpellCheck.prototype.language_ = &#39;&#39;;
<a name="line115"></a>
<a name="line116"></a>
<a name="line117"></a>/**
<a name="line118"></a> * Cache for set language. Reference to the element corresponding to the set
<a name="line119"></a> * language in the static goog.spell.SpellCheck.cache_.
<a name="line120"></a> *
<a name="line121"></a> * @type {Object|undefined}
<a name="line122"></a> * @private
<a name="line123"></a> */
<a name="line124"></a>goog.spell.SpellCheck.prototype.cache_;
<a name="line125"></a>
<a name="line126"></a>
<a name="line127"></a>/**
<a name="line128"></a> * Id for timer processing the pending queue.
<a name="line129"></a> *
<a name="line130"></a> * @type {number}
<a name="line131"></a> * @private
<a name="line132"></a> */
<a name="line133"></a>goog.spell.SpellCheck.prototype.queueTimer_ = 0;
<a name="line134"></a>
<a name="line135"></a>
<a name="line136"></a>/**
<a name="line137"></a> * Whether a lookup operation is in progress.
<a name="line138"></a> *
<a name="line139"></a> * @type {boolean}
<a name="line140"></a> * @private
<a name="line141"></a> */
<a name="line142"></a>goog.spell.SpellCheck.prototype.lookupInProgress_ = false;
<a name="line143"></a>
<a name="line144"></a>
<a name="line145"></a>/**
<a name="line146"></a> * Codes representing the status of an individual word.
<a name="line147"></a> *
<a name="line148"></a> * @enum {number}
<a name="line149"></a> */
<a name="line150"></a>goog.spell.SpellCheck.WordStatus = {
<a name="line151"></a>  UNKNOWN: 0,
<a name="line152"></a>  VALID: 1,
<a name="line153"></a>  INVALID: 2,
<a name="line154"></a>  IGNORED: 3,
<a name="line155"></a>  CORRECTED: 4 // Temporary status, not stored in cache
<a name="line156"></a>};
<a name="line157"></a>
<a name="line158"></a>
<a name="line159"></a>/**
<a name="line160"></a> * Fields for word array in cache.
<a name="line161"></a> *
<a name="line162"></a> * @enum {number}
<a name="line163"></a> */
<a name="line164"></a>goog.spell.SpellCheck.CacheIndex = {
<a name="line165"></a>  STATUS: 0,
<a name="line166"></a>  SUGGESTIONS: 1
<a name="line167"></a>};
<a name="line168"></a>
<a name="line169"></a>
<a name="line170"></a>/**
<a name="line171"></a> * Regular expression for identifying word boundaries.
<a name="line172"></a> *
<a name="line173"></a> * @type {string}
<a name="line174"></a> */
<a name="line175"></a>goog.spell.SpellCheck.WORD_BOUNDARY_CHARS =
<a name="line176"></a>    &#39;\t\r\n\u00A0 !\&quot;#$%&amp;()*+,\-.\/:;&lt;=&gt;?@\[\\\]^_`{|}~&#39;;
<a name="line177"></a>
<a name="line178"></a>
<a name="line179"></a>/**
<a name="line180"></a> * Regular expression for identifying word boundaries.
<a name="line181"></a> *
<a name="line182"></a> * @type {RegExp}
<a name="line183"></a> */
<a name="line184"></a>goog.spell.SpellCheck.WORD_BOUNDARY_REGEX = new RegExp(
<a name="line185"></a>    &#39;[&#39; + goog.spell.SpellCheck.WORD_BOUNDARY_CHARS + &#39;]&#39;);
<a name="line186"></a>
<a name="line187"></a>
<a name="line188"></a>/**
<a name="line189"></a> * Regular expression for splitting a string into individual words and blocks of
<a name="line190"></a> * separators. Matches zero or one word followed by zero or more separators.
<a name="line191"></a> *
<a name="line192"></a> * @type {RegExp}
<a name="line193"></a> */
<a name="line194"></a>goog.spell.SpellCheck.SPLIT_REGEX = new RegExp(
<a name="line195"></a>    &#39;([^&#39; + goog.spell.SpellCheck.WORD_BOUNDARY_CHARS + &#39;]*)&#39; +
<a name="line196"></a>    &#39;([&#39; + goog.spell.SpellCheck.WORD_BOUNDARY_CHARS + &#39;]*)&#39;);
<a name="line197"></a>
<a name="line198"></a>
<a name="line199"></a>/**
<a name="line200"></a> * Sets the lookup function.
<a name="line201"></a> *
<a name="line202"></a> * @param {Function} f Function to use for word lookup. Must accept an array of
<a name="line203"></a> *     words, an object reference and a callback function as parameters.
<a name="line204"></a> *     It must also call the callback function (as a method on the object),
<a name="line205"></a> *     once ready, with an array containing the original words, their
<a name="line206"></a> *     spelling status and optionally an array of suggestions.
<a name="line207"></a> */
<a name="line208"></a>goog.spell.SpellCheck.prototype.setLookupFunction = function(f) {
<a name="line209"></a>  this.lookupFunction_ = f;
<a name="line210"></a>};
<a name="line211"></a>
<a name="line212"></a>
<a name="line213"></a>/**
<a name="line214"></a> * Sets language.
<a name="line215"></a> *
<a name="line216"></a> * @param {string=} opt_language Content language.
<a name="line217"></a> */
<a name="line218"></a>goog.spell.SpellCheck.prototype.setLanguage = function(opt_language) {
<a name="line219"></a>  this.language_ = opt_language || &#39;&#39;;
<a name="line220"></a>
<a name="line221"></a>  if (!goog.spell.SpellCheck.cache_[this.language_]) {
<a name="line222"></a>    goog.spell.SpellCheck.cache_[this.language_] = {};
<a name="line223"></a>  }
<a name="line224"></a>  this.cache_ = goog.spell.SpellCheck.cache_[this.language_];
<a name="line225"></a>};
<a name="line226"></a>
<a name="line227"></a>
<a name="line228"></a>/**
<a name="line229"></a> * Returns language.
<a name="line230"></a> *
<a name="line231"></a> * @return {string} Content language.
<a name="line232"></a> */
<a name="line233"></a>goog.spell.SpellCheck.prototype.getLanguage = function() {
<a name="line234"></a>  return this.language_;
<a name="line235"></a>};
<a name="line236"></a>
<a name="line237"></a>
<a name="line238"></a>/**
<a name="line239"></a> * Checks spelling for a block of text.
<a name="line240"></a> *
<a name="line241"></a> * @param {string} text Block of text to spell check.
<a name="line242"></a> */
<a name="line243"></a>goog.spell.SpellCheck.prototype.checkBlock = function(text) {
<a name="line244"></a>  var words = text.split(goog.spell.SpellCheck.WORD_BOUNDARY_REGEX);
<a name="line245"></a>
<a name="line246"></a>  var len = words.length;
<a name="line247"></a>  for (var word, i = 0; i &lt; len; i++) {
<a name="line248"></a>    word = words[i];
<a name="line249"></a>    this.checkWord_(word);
<a name="line250"></a>  }
<a name="line251"></a>
<a name="line252"></a>  if (!this.queueTimer_ &amp;&amp; !this.lookupInProgress_ &amp;&amp;
<a name="line253"></a>      this.unknownWords_.getCount()) {
<a name="line254"></a>    this.processPending_();
<a name="line255"></a>  }
<a name="line256"></a>  else if (this.unknownWords_.getCount() == 0) {
<a name="line257"></a>    this.dispatchEvent(goog.spell.SpellCheck.EventType.READY);
<a name="line258"></a>  }
<a name="line259"></a>};
<a name="line260"></a>
<a name="line261"></a>
<a name="line262"></a>/**
<a name="line263"></a> * Checks spelling for a single word. Returns the status of the supplied word,
<a name="line264"></a> * or UNKNOWN if it&#39;s not cached. If it&#39;s not cached the word is added to a
<a name="line265"></a> * queue and checked with the verification implementation with a short delay.
<a name="line266"></a> *
<a name="line267"></a> * @param {string} word Word to check spelling of.
<a name="line268"></a> * @return {goog.spell.SpellCheck.WordStatus} The status of the supplied word,
<a name="line269"></a> *     or UNKNOWN if it&#39;s not cached.
<a name="line270"></a> */
<a name="line271"></a>goog.spell.SpellCheck.prototype.checkWord = function(word) {
<a name="line272"></a>  var status = this.checkWord_(word);
<a name="line273"></a>
<a name="line274"></a>  if (status == goog.spell.SpellCheck.WordStatus.UNKNOWN &amp;&amp;
<a name="line275"></a>      !this.queueTimer_ &amp;&amp; !this.lookupInProgress_) {
<a name="line276"></a>    this.queueTimer_ = goog.Timer.callOnce(this.processPending_,
<a name="line277"></a>        goog.spell.SpellCheck.LOOKUP_DELAY_, this);
<a name="line278"></a>  }
<a name="line279"></a>
<a name="line280"></a>  return status;
<a name="line281"></a>};
<a name="line282"></a>
<a name="line283"></a>
<a name="line284"></a>/**
<a name="line285"></a> * Checks spelling for a single word. Returns the status of the supplied word,
<a name="line286"></a> * or UNKNOWN if it&#39;s not cached.
<a name="line287"></a> *
<a name="line288"></a> * @param {string} word Word to check spelling of.
<a name="line289"></a> * @return {goog.spell.SpellCheck.WordStatus} The status of the supplied word,
<a name="line290"></a> *     or UNKNOWN if it&#39;s not cached.
<a name="line291"></a> * @private
<a name="line292"></a> */
<a name="line293"></a>goog.spell.SpellCheck.prototype.checkWord_ = function(word) {
<a name="line294"></a>  if (!word) {
<a name="line295"></a>    return goog.spell.SpellCheck.WordStatus.INVALID;
<a name="line296"></a>  }
<a name="line297"></a>
<a name="line298"></a>  var cacheEntry = this.cache_[word];
<a name="line299"></a>  if (!cacheEntry) {
<a name="line300"></a>    this.unknownWords_.add(word);
<a name="line301"></a>    return goog.spell.SpellCheck.WordStatus.UNKNOWN;
<a name="line302"></a>  }
<a name="line303"></a>
<a name="line304"></a>  return cacheEntry[goog.spell.SpellCheck.CacheIndex.STATUS];
<a name="line305"></a>};
<a name="line306"></a>
<a name="line307"></a>
<a name="line308"></a>/**
<a name="line309"></a> * Processes pending words unless a lookup operation has already been queued or
<a name="line310"></a> * is in progress.
<a name="line311"></a> *
<a name="line312"></a> * @throws {Error}
<a name="line313"></a> */
<a name="line314"></a>goog.spell.SpellCheck.prototype.processPending = function() {
<a name="line315"></a>  if (this.unknownWords_.getCount()) {
<a name="line316"></a>    if (!this.queueTimer_ &amp;&amp; !this.lookupInProgress_) {
<a name="line317"></a>      this.processPending_();
<a name="line318"></a>    }
<a name="line319"></a>  } else {
<a name="line320"></a>    this.dispatchEvent(goog.spell.SpellCheck.EventType.READY);
<a name="line321"></a>  }
<a name="line322"></a>};
<a name="line323"></a>
<a name="line324"></a>
<a name="line325"></a>/**
<a name="line326"></a> * Processes pending words using the verification callback.
<a name="line327"></a> *
<a name="line328"></a> * @throws {Error}
<a name="line329"></a> * @private
<a name="line330"></a> */
<a name="line331"></a>goog.spell.SpellCheck.prototype.processPending_ = function() {
<a name="line332"></a>  if (!this.lookupFunction_) {
<a name="line333"></a>    throw Error(&#39;No lookup function provided for spell checker.&#39;);
<a name="line334"></a>  }
<a name="line335"></a>
<a name="line336"></a>  if (this.unknownWords_.getCount()) {
<a name="line337"></a>    this.lookupInProgress_ = true;
<a name="line338"></a>    var func = this.lookupFunction_;
<a name="line339"></a>    func(this.unknownWords_.getValues(), this, this.lookupCallback_);
<a name="line340"></a>  } else {
<a name="line341"></a>    this.dispatchEvent(goog.spell.SpellCheck.EventType.READY);
<a name="line342"></a>  }
<a name="line343"></a>
<a name="line344"></a>  this.queueTimer_ = 0;
<a name="line345"></a>};
<a name="line346"></a>
<a name="line347"></a>
<a name="line348"></a>/**
<a name="line349"></a> * Callback for lookup function.
<a name="line350"></a> *
<a name="line351"></a> * @param {Array.&lt;Array&gt;} data Data array. Each word is represented by an
<a name="line352"></a> *     array containing the word, the status and optionally an array of
<a name="line353"></a> *     suggestions. Passing null indicates that the operation failed.
<a name="line354"></a> * @private
<a name="line355"></a> *
<a name="line356"></a> * Example:
<a name="line357"></a> * obj.lookupCallback_([
<a name="line358"></a> *   [&#39;word&#39;, VALID],
<a name="line359"></a> *   [&#39;wrod&#39;, INVALID, [&#39;word&#39;, &#39;wood&#39;, &#39;rod&#39;]]
<a name="line360"></a> * ]);
<a name="line361"></a> */
<a name="line362"></a>goog.spell.SpellCheck.prototype.lookupCallback_ = function(data) {
<a name="line363"></a>
<a name="line364"></a>  // Lookup function failed; abort then dispatch error event.
<a name="line365"></a>  if (data == null) {
<a name="line366"></a>    if (this.queueTimer_) {
<a name="line367"></a>      goog.Timer.clear(this.queueTimer_);
<a name="line368"></a>      this.queueTimer_ = 0;
<a name="line369"></a>    }
<a name="line370"></a>    this.lookupInProgress_ = false;
<a name="line371"></a>
<a name="line372"></a>    this.dispatchEvent(goog.spell.SpellCheck.EventType.ERROR);
<a name="line373"></a>    return;
<a name="line374"></a>  }
<a name="line375"></a>
<a name="line376"></a>  for (var a, i = 0; a = data[i]; i++) {
<a name="line377"></a>    this.setWordStatus_(a[0], a[1], a[2]);
<a name="line378"></a>  }
<a name="line379"></a>  this.lookupInProgress_ = false;
<a name="line380"></a>
<a name="line381"></a>  // Fire ready event if all pending words have been processed.
<a name="line382"></a>  if (this.unknownWords_.getCount() == 0) {
<a name="line383"></a>    this.dispatchEvent(goog.spell.SpellCheck.EventType.READY);
<a name="line384"></a>
<a name="line385"></a>  // Process pending
<a name="line386"></a>  } else if (!this.queueTimer_) {
<a name="line387"></a>    this.queueTimer_ = goog.Timer.callOnce(this.processPending_,
<a name="line388"></a>        goog.spell.SpellCheck.LOOKUP_DELAY_, this);
<a name="line389"></a>  }
<a name="line390"></a>};
<a name="line391"></a>
<a name="line392"></a>
<a name="line393"></a>/**
<a name="line394"></a> * Sets a words spelling status.
<a name="line395"></a> *
<a name="line396"></a> * @param {string} word Word to set status for.
<a name="line397"></a> * @param {goog.spell.SpellCheck.WordStatus} status Status of word.
<a name="line398"></a> * @param {Array.&lt;string&gt;=} opt_suggestions Suggestions.
<a name="line399"></a> *
<a name="line400"></a> * Example:
<a name="line401"></a> * obj.setWordStatus(&#39;word&#39;, VALID);
<a name="line402"></a> * obj.setWordStatus(&#39;wrod&#39;, INVALID, [&#39;word&#39;, &#39;wood&#39;, &#39;rod&#39;]);.
<a name="line403"></a> */
<a name="line404"></a>goog.spell.SpellCheck.prototype.setWordStatus =
<a name="line405"></a>    function(word, status, opt_suggestions) {
<a name="line406"></a>  this.setWordStatus_(word, status, opt_suggestions);
<a name="line407"></a>};
<a name="line408"></a>
<a name="line409"></a>
<a name="line410"></a>/**
<a name="line411"></a> * Sets a words spelling status.
<a name="line412"></a> *
<a name="line413"></a> * @param {string} word Word to set status for.
<a name="line414"></a> * @param {goog.spell.SpellCheck.WordStatus} status Status of word.
<a name="line415"></a> * @param {Array.&lt;string&gt;=} opt_suggestions Suggestions.
<a name="line416"></a> * @private
<a name="line417"></a> */
<a name="line418"></a>goog.spell.SpellCheck.prototype.setWordStatus_ =
<a name="line419"></a>    function(word, status, opt_suggestions) {
<a name="line420"></a>  var suggestions = opt_suggestions || [];
<a name="line421"></a>  this.cache_[word] = [status, suggestions];
<a name="line422"></a>  this.unknownWords_.remove(word);
<a name="line423"></a>
<a name="line424"></a>  this.dispatchEvent(
<a name="line425"></a>      new goog.spell.SpellCheck.WordChangedEvent(this, word, status));
<a name="line426"></a>};
<a name="line427"></a>
<a name="line428"></a>
<a name="line429"></a>/**
<a name="line430"></a> * Returns suggestions for the given word.
<a name="line431"></a> *
<a name="line432"></a> * @param {string} word Word to get suggestions for.
<a name="line433"></a> * @return {Array.&lt;string&gt;} An array of suggestions for the given word.
<a name="line434"></a> */
<a name="line435"></a>goog.spell.SpellCheck.prototype.getSuggestions = function(word) {
<a name="line436"></a>  var cacheEntry = this.cache_[word];
<a name="line437"></a>
<a name="line438"></a>  if (!cacheEntry) {
<a name="line439"></a>    this.checkWord(word);
<a name="line440"></a>    return [];
<a name="line441"></a>  }
<a name="line442"></a>
<a name="line443"></a>  return cacheEntry[goog.spell.SpellCheck.CacheIndex.STATUS] ==
<a name="line444"></a>      goog.spell.SpellCheck.WordStatus.INVALID ?
<a name="line445"></a>      cacheEntry[goog.spell.SpellCheck.CacheIndex.SUGGESTIONS] : [];
<a name="line446"></a>};
<a name="line447"></a>
<a name="line448"></a>
<a name="line449"></a>
<a name="line450"></a>/**
<a name="line451"></a> * Object representing a word changed event. Fired when the status of a word
<a name="line452"></a> * changes.
<a name="line453"></a> *
<a name="line454"></a> * @param {goog.spell.SpellCheck} target Spellcheck object initiating event.
<a name="line455"></a> * @param {string} word Word to set status for.
<a name="line456"></a> * @param {goog.spell.SpellCheck.WordStatus} status Status of word.
<a name="line457"></a> * @extends {goog.events.Event}
<a name="line458"></a> * @constructor
<a name="line459"></a> * @final
<a name="line460"></a> */
<a name="line461"></a>goog.spell.SpellCheck.WordChangedEvent = function(target, word, status) {
<a name="line462"></a>  goog.events.Event.call(this, goog.spell.SpellCheck.EventType.WORD_CHANGED,
<a name="line463"></a>      target);
<a name="line464"></a>
<a name="line465"></a>  /**
<a name="line466"></a>   * Word the status has changed for.
<a name="line467"></a>   * @type {string}
<a name="line468"></a>   */
<a name="line469"></a>  this.word = word;
<a name="line470"></a>
<a name="line471"></a>  /**
<a name="line472"></a>   * New status
<a name="line473"></a>   * @type {goog.spell.SpellCheck.WordStatus}
<a name="line474"></a>   */
<a name="line475"></a>  this.status = status;
<a name="line476"></a>};
<a name="line477"></a>goog.inherits(goog.spell.SpellCheck.WordChangedEvent, goog.events.Event);
</pre>


</body>
</html>
